home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-16 | 5.6 KB | 165 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWGConst.cpp
- // Release Version: $ ODF 3 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- #ifndef FWCOLOR_H
- #include "FWColor.h"
- #endif
-
- #ifndef FWINK_H
- #include "FWInk.h"
- #endif
-
- #ifndef FWSTYLE_H
- #include "FWStyle.h"
- #endif
-
- #ifndef FWFONT_H
- #include "FWFont.h"
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment FWGraphics_Constants
- #endif
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- // ----- Standard Colors -----
-
- // I only define colors that are common
-
- #define FW_RGB(r, g, b) (((unsigned long)(r)) | ((unsigned long)(g) << 8) | ((unsigned long)(b) << 16))
-
- #ifdef FW_BUILD_WIN
- const FW_SColor FW_kRGBBlack = { FW_RGB(0x00, 0x00, 0x00) };
- const FW_SColor FW_kRGBWhite = { FW_RGB(0xFF, 0xFF, 0xFF) };
- const FW_SColor FW_kRGBRed = { FW_RGB(0xFF, 0x00, 0x00) };
- const FW_SColor FW_kRGBYellow = { FW_RGB(0xFF, 0xFF, 0x00) };
- const FW_SColor FW_kRGBBlue = { FW_RGB(0x00, 0x00, 0xC0) };
- const FW_SColor FW_kRGBGreen = { FW_RGB(0x00, 0xFF, 0x00) };
- const FW_SColor FW_kRGBBrown = { FW_RGB(0x80, 0x80, 0x00) };
- const FW_SColor FW_kRGBPurple = { FW_RGB(0xFF, 0x00, 0xFF) };
- const FW_SColor FW_kRGBLightBlue = { FW_RGB(0x00, 0x00, 0xFF) };
- const FW_SColor FW_kRGBGray = { FW_RGB(0x80, 0x80, 0x80) };
- const FW_SColor FW_kRGBLightGray = { FW_RGB(0xC0, 0xC0, 0xC0) };
- const FW_SColor FW_kRGBDarkGray = { FW_RGB(0x40, 0x40, 0x40) };
- #endif
-
- #ifdef FW_BUILD_MAC
- const FW_SColor FW_kRGBBlack = { FW_RGB(0x00, 0x00, 0x00) };
- const FW_SColor FW_kRGBWhite = { FW_RGB(0xFF, 0xFF, 0xFF) };
- const FW_SColor FW_kRGBRed = { FW_RGB(0xDD, 0x00, 0x00) };
- const FW_SColor FW_kRGBYellow = { FW_RGB(0xFF, 0xFF, 0x00) };
- const FW_SColor FW_kRGBBlue = { FW_RGB(0x00, 0x00, 0xDD) };
- const FW_SColor FW_kRGBGreen = { FW_RGB(0x00, 0xEE, 0x00) };
- const FW_SColor FW_kRGBBrown = { FW_RGB(0x99, 0x66, 0x00) };
- const FW_SColor FW_kRGBPurple = { FW_RGB(0x66, 0x00, 0x99) };
- const FW_SColor FW_kRGBLightBlue = { FW_RGB(0x00, 0x99, 0xFF) };
- const FW_SColor FW_kRGBGray = { FW_RGB(0x80, 0x80, 0x80) };
- const FW_SColor FW_kRGBLightGray = { FW_RGB(0xC0, 0xC0, 0xC0) };
- const FW_SColor FW_kRGBDarkGray = { FW_RGB(0x40, 0x40, 0x40) };
- #endif
-
- // ----- Standard patterns -----
-
- // [HLX] should be moved to resource
-
- const FW_BitPattern FW_kBlackPat = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; // black
- const FW_BitPattern FW_kWhitePat = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // White
- const FW_BitPattern FW_kGrayPat = {0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55}; // Gray
- const FW_BitPattern FW_kLightGrayPat = {0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22}; // LightGray
- const FW_BitPattern FW_kDarkGrayPat = {0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD}; // DarkGray
- const FW_BitPattern FW_kHorizontalPat = {0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00}; // Horizontal
- const FW_BitPattern FW_kVerticalPat = {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}; // Vertical
- const FW_BitPattern FW_kFDiagonalPat = {0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11}; // FDiagonal
- const FW_BitPattern FW_kBDiagonalPat = {0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88}; // DDiagonal
- const FW_BitPattern FW_kCrossPat = {0x88, 0x88, 0x88, 0xFF, 0x88, 0x88, 0x88, 0xFF}; // Cross
- const FW_BitPattern FW_kDiagCrossPat = {0x88, 0x55, 0x22, 0x55, 0x88, 0x55, 0x22, 0x55}; // DiagCross
- const FW_BitPattern FW_kAntPat = {0xEE, 0x77, 0xBB, 0xDD, 0xEE, 0x77, 0xBB, 0xDD}; // Ant
-
-
- // ------ Standard font names -----
- #ifdef FW_BUILD_MAC
- static FW_CString FW_kPrivSystemFontName("systemFont");
- static FW_CString FW_kPrivDefaultFontName("applFont");
- static FW_CString FW_kPrivHelveticaFontName("Helvetica");
- static FW_CString FW_kPrivTimesFontName("Times");
- static FW_CString FW_kPrivCourierFontName("Courier");
- static FW_CString FW_kPrivPalatinoFontName("Palatino");
- #endif
-
- #ifdef FW_BUILD_WIN
- static FW_CString FW_kPrivSystemFontName("System");
- static FW_CString FW_kPrivDefaultFontName("System");
- static FW_CString FW_kPrivHelveticaFontName("Arial");
- static FW_CString FW_kPrivTimesFontName("Times New Roman");
- static FW_CString FW_kPrivCourierFontName("Courier New");
- static FW_CString FW_kPrivPalatinoFontName("Palatino");
- #endif
-
-
- const FW_CString& FW_GetSystemFontName()
- {
- return FW_kPrivSystemFontName;
- }
-
- const FW_CString& FW_GetDefaultFontName()
- {
- return FW_kPrivDefaultFontName;
- }
-
- const FW_CString& FW_GetHelveticaFontName()
- {
- return FW_kPrivHelveticaFontName;
- }
-
- const FW_CString& FW_GetTimesFontName()
- {
- return FW_kPrivTimesFontName;
- }
-
- const FW_CString& FW_GetCourierFontName()
- {
- return FW_kPrivCourierFontName;
- }
-
- const FW_CString& FW_GetPalatinoFontName()
- {
- return FW_kPrivPalatinoFontName;
- }
-
- #ifdef FW_BUILD_MAC
- const FW_CString FW_MacGetFontName(short macFontID)
- {
- Str255 pstr;
- ::GetFontName(macFontID, pstr); // Get the font's name
- FW_Locale locale;
- locale.fScriptCode = ::FontToScript(macFontID); // Get the font's locale
- locale.fLangCode = ::GetScriptVariable(locale.fScriptCode, smScriptLang);
- FW_CString fontName("", locale);
- fontName.ReplaceAll(pstr);
- return fontName;
- }
- #endif
-